home *** CD-ROM | disk | FTP | other *** search
/ Alles Voor Internet / Tout Pour Internet / alles voor internet.iso / MacInternet™ / Telnet / Terminal 2.2 / Terminal Folder / Capture.s < prev    next >
Text File  |  1990-12-31  |  735b  |  34 lines

  1. /*
  2.     Terminal 2.0 script
  3.     "Capture.s"
  4.  
  5.     Create a new unique capture file and open it.
  6. */
  7.  
  8. main()
  9. {
  10.     char name[32];
  11.     int year, month, day, hour, minute, second, weekday;
  12.  
  13.     /* Get Macintosh date and time */
  14.  
  15.     date(time(), &year, &month, &day, &hour, &minute, &second, &weekday);
  16.  
  17.     /* Use date and time to build a unique file name */
  18.  
  19.     format(name, "Capture %04i%02i%02i%02i%02i%02i",
  20.         year, month, day, hour, minute, second);
  21.  
  22.     /* Start capturing incoming data into that file */
  23.  
  24.     if (capture(1, name)) {
  25.         beep();    /* If error */
  26.         return;
  27.     }
  28.  
  29.     /* The following text is displayed and also captured into the file */
  30.  
  31.     display("*** Start of capture file %02i-%02i-%04i %02i:%02i:%02i ***\r\r",
  32.         day, month, year, hour, minute, second);
  33. }
  34.